/**
 * <b>项目名：</b>ht-web<br/>  
 * <b>包名：</b>com.flea.hclv.service.impl<br/>  
 * <b>文件名：</b>PersonInfoServiceImpl.java<br/>  
 * <b>版本信息：</b>1.0<br/>  
 * <b>日期：</b>2019年8月8日 上午11:26:50<br/>  
 * <b>COPYRIGHT 2010-2012 ALL RIGHTS RESERVED 虫子科技</b>-版权所有<br/>
 */
package com.flea.hclv.service.impl;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.session.RowBounds;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSONObject;
import com.flea.hclv.model.dao.FaceInfoMapper;
import com.flea.hclv.model.dao.PersonInfoAuditMapper;
import com.flea.hclv.model.dao.PersonInfoCodeMapper;
import com.flea.hclv.model.dao.PersonInfoMapper;
import com.flea.hclv.model.entity.PersonInfo;
import com.flea.hclv.model.entity.PersonInfoAudit;
import com.flea.hclv.model.entity.PersonInfoCode;
import com.flea.hclv.model.entity.vo.StaticDataVo;
import com.flea.hclv.service.PersonInfoService;
import com.flea.hclv.util.HclvDictUtil;
import com.flea.hclv.util.ServerResponse;
import com.flea.system.base.util.StringUtil;
import com.flea.system.bean.FleaPage;
import com.flea.system.entity.OrgDept;
import com.flea.system.entity.OrgUser;
import com.flea.system.entity.WebDict;
import com.flea.system.platform.session.FleaOrgUtils;
import com.flea.system.utils.FleaStringUtils;

import kafka.consumer.OldConsumer;

/**
 * @description TODO
 * @createTime 2019年8月8日 上午11:26:50
 * @modifyTime
 * @author myflea@163.com
 * @version 1.0
 */
@Service
public class PersonInfoServiceImpl implements PersonInfoService {
	@Autowired
	private PersonInfoMapper personInfoMapper;
	@Autowired
	private PersonInfoAuditMapper personInfoAuditMapper;
	@Autowired
	private FaceInfoMapper faceInfoMapper;

	@Autowired
	private PersonInfoCodeMapper personInfoCodeMapper;

	@Override
	public ServerResponse<String> saveOrUpdate(String userId,
			OrgDept currentUserDept, PersonInfo personInfo) {
		
		OrgUser orgUser = 	FleaOrgUtils.getUserByUserUuid(userId);
		String bdType = orgUser.getExtend1();
		
		   if (StringUtil.isEmpty(bdType)){
	            return ServerResponse.createByErrorMessage("当前人员信息未设置标段信息，请联系管理员");
	        }

        if (personInfo==null){
            return ServerResponse.createByErrorMessage("人员信息为空");
        }
        String id = personInfo.getId();
        int result;
        if (id == null) {
        	
        	//获取身份证号码，然后判断系统中该身份证用户的人员是否已经存在
        	if(!StringUtil.isEmpty(personInfo.getCardSn())) {
        		PersonInfo resultCheck  =	personInfoMapper.findByCardSn(personInfo.getCardSn());

        		 if(resultCheck!=null) {
        			 return ServerResponse.createByErrorMessage("该人员已经存在"); }
        	}
        	
        	
			
			 
			 
        	
            id = FleaStringUtils.getGenerateUUID();
            personInfo.setId(id);
            PersonInfoCode pcode =  personInfoCodeMapper.selectOneByRandom();
            personInfoCodeMapper.deleteByPrimaryKey(pcode.getId());
            personInfo.setPersonNo(pcode.getPersonNo());
            personInfo.setCreateUser(userId);
            personInfo.setModifyUser(userId);
            personInfo.setOperType("0");
            if(!bdType.equals("BD000")) {
            	 personInfo.setWorkerType(bdType);
            }
            
            
           
            result = personInfoMapper.insertSelective(personInfo);
            if (result<0){
                return ServerResponse.createByErrorMessage("人员添加失败");
            }
           String projectCodes = personInfo.getProjectCode();
           if(!StringUtil.isEmpty(projectCodes)){
        	   if(projectCodes.contains("ALLStation")){
        		   List<WebDict> projects =  HclvDictUtil.getHTProjectList();
        		   for (WebDict webDict : projects) {
        			   PersonInfo audit = personInfo;
            		   audit.setProjectCode(webDict.getDictCode());
            		   personInfoAuditMapper.insertSelective(audit);
				}
        	   }else{
        		   String[] codes = projectCodes.split(",");
            	   for (String string : codes) {
            		   PersonInfo audit = personInfo;
            		   audit.setProjectCode(string);
            		   audit.setFlag(0);
            		   personInfoAuditMapper.insertSelective(audit);
    			}
        	   }
        	   
        	   
        	   
           }
           
           
            
        }else {
        	PersonInfo old = personInfoMapper.selectByPrimaryKey(id);
        	//需要判断哪些信息可以修改，哪些信息不可以修改
        	personInfo.setOperType("1");
        	personInfo.setModifyUser(userId);
        	 //personInfo.setWorkerType(bdType);
            result = personInfoMapper.updateByPrimaryKeySelective(personInfo);
            if (result<0){
                return ServerResponse.createByErrorMessage("人员更新失败");
            }
            
            List<WebDict> projects =  HclvDictUtil.getHTProjectList();
            List<String> allCode = new ArrayList<String>();
            for (WebDict p : projects) {
            	allCode.add(p.getDictCode());	
			}
            allCode.remove("ALLStation");
            
            
            
            
            String oldProjectCodes = old.getProjectCode();
            String projectCodes = personInfo.getProjectCode();
            
            
            
            
       	 String[] oldCodesA = oldProjectCodes.split(",");
       	 List<String> oldCodesArrayA = FleaStringUtils.StringArrayToList(oldCodesA);
       	 String[] newCodesA = projectCodes.split(",");
       	 List<String> newCodesArrayA = FleaStringUtils.StringArrayToList(newCodesA);
       	 
       	 boolean isNotAllInNew =true;
       	 for (String oa : oldCodesArrayA) {
       		if(!newCodesArrayA.contains(oa)){
       			isNotAllInNew = false;
       		}	
		}
       	 boolean isNotAllInOld =true;
       	 for (String na : newCodesArrayA) {
       		if(!oldCodesArrayA.contains(na)){
       			isNotAllInOld = false;
       		}
		}
       	 boolean isSame = isNotAllInOld&&isNotAllInNew;
       	 boolean isAll = oldProjectCodes.contains("ALLStation")&&projectCodes.contains("ALLStation");
       	 
            
            
            //0、code没有变化,变更其他字段
            if(oldProjectCodes.equals(projectCodes)||isAll||isSame){
              	   if(projectCodes.contains("ALLStation")){
              		  
                  	 personInfo.setName(old.getName());
                     personInfo.setFolk(old.getFolk());
                     personInfo.setSex(old.getSex());
                     personInfo.setBirthDay(old.getBirthDay());
                     personInfo.setCardSn(old.getCardSn());
                     personInfo.setAddress(old.getAddress());
                     personInfo.setAgency(old.getAgency());
                     personInfo.setValidDuring(old.getValidDuring());
                     personInfo.setSamid(old.getSamid());
                     personInfo.setIdCardSn(old.getIdCardSn());
                     personInfo.setJpgPhotobuf(old.getJpgPhotobuf());
                     personInfo.setCreateUser(old.getCreateUser());
                     
              		   for (String c : allCode) {
              			   PersonInfo audit = personInfo;
                  		   audit.setProjectCode(c);
                  		   audit.setOperType("1");
                  		 audit.setFlag(0);
                  		   personInfoAuditMapper.insertSelective(audit);
                  		 
      				}
              	   }else{ 
              		 String[] codes = projectCodes.split(",");
                  	 personInfo.setName(old.getName());
                     personInfo.setFolk(old.getFolk());
                     personInfo.setSex(old.getSex());
                     personInfo.setBirthDay(old.getBirthDay());
                     personInfo.setCardSn(old.getCardSn());
                     personInfo.setAddress(old.getAddress());
                     personInfo.setAgency(old.getAgency());
                     personInfo.setValidDuring(old.getValidDuring());
                     personInfo.setSamid(old.getSamid());
                     personInfo.setIdCardSn(old.getIdCardSn());
                     personInfo.setJpgPhotobuf(old.getJpgPhotobuf());
                     personInfo.setCreateUser(old.getCreateUser());
                   	   for (String string : codes) {
                   		   PersonInfo audit = personInfo;
                   		   audit.setProjectCode(string);
                   			audit.setOperType("1");
                   			audit.setFlag(0);
                   			 personInfoAuditMapper.insertSelective(audit);
           			}
              }
            }else {
            	
            	if(!projectCodes.contains("ALLStation")&&!oldProjectCodes.contains("ALLStation")) {
            		 //1、判读那些是新增
               	 String[] oldCodes = oldProjectCodes.split(",");
               	 List<String> oldCodesArray = FleaStringUtils.StringArrayToList(oldCodes);
               	 String[] newCodes = projectCodes.split(",");
               	 List<String> newCodesArray = FleaStringUtils.StringArrayToList(newCodes);
               	 
               	 List<String> newAddCode = new ArrayList<String>();
               	 List<String> newDeleteCode = new ArrayList<String>();
               	 List<String> newUpdateCode = new ArrayList<String>();
               	 
               	 for (String oldC : oldCodesArray) {
               		 if(newCodesArray.contains(oldC)) {
               			newUpdateCode.add(oldC);
               		 }else {
               			newDeleteCode.add(oldC);
               		 }
                 }
               	 for (String nc : newCodesArray) {
               		 
               		 if(!oldCodesArray.contains(nc)) {
               			newAddCode.add(nc);
               		 }	
				}
                 personInfo.setName(old.getName());
                 personInfo.setFolk(old.getFolk());
                 personInfo.setSex(old.getSex());
                 personInfo.setBirthDay(old.getBirthDay());
                 personInfo.setCardSn(old.getCardSn());
                 personInfo.setAddress(old.getAddress());
                 personInfo.setAgency(old.getAgency());
                 personInfo.setValidDuring(old.getValidDuring());
                 personInfo.setSamid(old.getSamid());
                 personInfo.setIdCardSn(old.getIdCardSn());
                 personInfo.setJpgPhotobuf(old.getJpgPhotobuf());
                 personInfo.setCreateUser(old.getCreateUser());
               
            	 
            	 for (String c : newAddCode) {
            		 PersonInfo audit = personInfo;
             		   audit.setProjectCode(c);
             			audit.setOperType("0");
             			audit.setFlag(0);
             			 personInfoAuditMapper.insertSelective(audit);
				}
            	 for (String c : newUpdateCode) {
            		 PersonInfo audit = personInfo;
           		   audit.setProjectCode(c);
           			audit.setOperType("1");
           			audit.setFlag(0);
           			 personInfoAuditMapper.insertSelective(audit);
            	 }
            	 for (String c : newDeleteCode) {
            		 PersonInfo audit = personInfo;
           		   	 audit.setProjectCode(c);
           			audit.setOperType("2");
           			audit.setFlag(0);
           			 personInfoAuditMapper.insertSelective(audit);
            	 }
               	 
   				}
               	 
//               	   personInfo.setWorkerType(old.getWorkerType());
//                      personInfo.setPersonRole(old.getPersonRole());
               	  
     
   		}
            	if(projectCodes.contains("ALLStation")&&!oldProjectCodes.contains("ALLStation")) {
            		//1、判读那些是新增
            		String[] oldCodes = oldProjectCodes.split(",");
            		List<String> oldCodesArray = FleaStringUtils.StringArrayToList(oldCodes);
            		
            		String[] newCodes = projectCodes.split(",");
            		List<String> newCodesArray = allCode;
            		List<String> newAddCode = new ArrayList<String>();
//            		List<String> newDeleteCode = new ArrayList<String>();
            		List<String> newUpdateCode = new ArrayList<String>();
            		
            		for (String nc : newCodesArray) {
            	
            			if(oldCodesArray.contains(nc)) {
            				newUpdateCode.add(nc);
            			}else {
            				newAddCode.add(nc);
            			}
            			
						
					}
            		
            		personInfo.setName(old.getName());
            		personInfo.setFolk(old.getFolk());
            		personInfo.setSex(old.getSex());
            		personInfo.setBirthDay(old.getBirthDay());
            		personInfo.setCardSn(old.getCardSn());
            		personInfo.setAddress(old.getAddress());
            		personInfo.setAgency(old.getAgency());
            		personInfo.setValidDuring(old.getValidDuring());
            		personInfo.setSamid(old.getSamid());
            		personInfo.setIdCardSn(old.getIdCardSn());
            		personInfo.setJpgPhotobuf(old.getJpgPhotobuf());
            		personInfo.setCreateUser(old.getCreateUser());
            		
            		
            		for (String c : newAddCode) {
            			PersonInfo audit = personInfo;
            			audit.setProjectCode(c);
            			audit.setFlag(0);
            			audit.setOperType("0");
            			personInfoAuditMapper.insertSelective(audit);
            		}
            		for (String c : newUpdateCode) {
            			PersonInfo audit = personInfo;
            			audit.setProjectCode(c);
            			audit.setFlag(0);
            			audit.setOperType("1");
            			personInfoAuditMapper.insertSelective(audit);
            		}
           
            		
            	}
            	if(oldProjectCodes.contains("ALLStation")&&!projectCodes.contains("ALLStation")) {
            		//1、判读那些是新增
            		String[] oldCodes = oldProjectCodes.split(",");
            		List<String> oldCodesArray = allCode;
            		
            		String[] newCodes = projectCodes.split(",");
            		List<String> newCodesArray = FleaStringUtils.StringArrayToList(newCodes);
//            		List<String> newAddCode = new ArrayList<String>();
            		List<String> newDeleteCode = new ArrayList<String>();
            		List<String> newUpdateCode = new ArrayList<String>();
            		
            		for (String oldC : oldCodesArray) {
            			
            			if(newCodesArray.contains(oldC)) {
            				newUpdateCode.add(oldC);
            			}else {
            				newDeleteCode.add(oldC);
            			}
            		}
            		
//               	   personInfo.setWorkerType(old.getWorkerType());
//                      personInfo.setPersonRole(old.getPersonRole());
            		personInfo.setName(old.getName());
            		personInfo.setFolk(old.getFolk());
            		personInfo.setSex(old.getSex());
            		personInfo.setBirthDay(old.getBirthDay());
            		personInfo.setCardSn(old.getCardSn());
            		personInfo.setAddress(old.getAddress());
            		personInfo.setAgency(old.getAgency());
            		personInfo.setValidDuring(old.getValidDuring());
            		personInfo.setSamid(old.getSamid());
            		personInfo.setIdCardSn(old.getIdCardSn());
            		personInfo.setJpgPhotobuf(old.getJpgPhotobuf());
            		personInfo.setCreateUser(old.getCreateUser());
            		
            		
            
            		for (String c : newUpdateCode) {
            			PersonInfo audit = personInfo;
            			audit.setProjectCode(c);
            			audit.setOperType("1");
            			audit.setFlag(0);
            			personInfoAuditMapper.insertSelective(audit);
            		}
            		for (String c : newDeleteCode) {
            			PersonInfo audit = personInfo;
            			audit.setProjectCode(c);
            			audit.setOperType("2");
            			audit.setFlag(0);
            			personInfoAuditMapper.insertSelective(audit);
            			
            		}
            		
            	}

            	
            	

        }return ServerResponse.createBySuccessMessage("操作成功");

	}

	@Override
	public ServerResponse<FleaPage<PersonInfo>> selectAll(int curPage, int pageSize, String projectCode, String name,
			String personNo,String team) {
		  RowBounds rowBounds = new RowBounds(curPage,pageSize);
		  
		  
		  
	        List<PersonInfo> list = personInfoMapper.selectAll(rowBounds,projectCode,name,personNo,team);
	        
	        return ServerResponse.createBySuccess(new FleaPage<>(list));
	}

	@Override
	public ServerResponse<String> deleteByIds(String userId, List<String> idList) {
		 int result = personInfoMapper.deleteByIds(idList,userId);
		 
		 
		 
		 
		 
		 personInfoAuditMapper.deleteByIds(idList,userId);
	        if (result<0){
	            return ServerResponse.createByErrorMessage("删除失败");
	        }
	        List<WebDict> projects =  HclvDictUtil.getHTProjectList();
	           List<String> allCode = new ArrayList<String>();
	           for (WebDict p : projects) {
	           	allCode.add(p.getDictCode());	
				}
	           allCode.remove("ALLStation");
	           
	        for (String id : idList) {
				PersonInfo personInfo = personInfoMapper.selectByPrimaryKey(id);
				if(("ALLStation").equals(personInfo.getProjectCode())) {
					for (String c : allCode) {
						personInfo.setOperType("2");
						personInfo.setFlag(0);
						personInfoAuditMapper.insertSelective(personInfo);
					}
				}else {
					personInfo.setOperType("2");
					personInfo.setFlag(0);
					personInfoAuditMapper.insertSelective(personInfo);
				}
			}
	        
	        return ServerResponse.createBySuccessMessage("删除成功");
	}

	@Override
	public ServerResponse<String> init() {
		List<PersonInfo> all = personInfoMapper.selectAllInit();
		for (PersonInfo personInfo : all) {
		     String projectCodes = personInfo.getProjectCode();
	            if(!StringUtil.isEmpty(projectCodes)){
	            	   if(projectCodes.contains("ALLStation")){
	            		   List<WebDict> projects =  HclvDictUtil.getHTProjectList();
	            		   for (WebDict webDict : projects) {
	            			   if(!webDict.getDictCode().equals("ALLStation")){
	            				   PersonInfo audit = personInfo;
		                		   audit.setProjectCode(webDict.getDictCode());
		                		   audit.setFlag(0);
		                		   personInfoAuditMapper.insertSelective(audit);
	            			   }
	    				}
	            	   }else{
	            		   String[] codes = projectCodes.split(",");
	                 	   for (String string : codes) {
	                 		   PersonInfo audit = personInfo;
	                 		   audit.setProjectCode(string);
	                 		   audit.setFlag(0);
	                 		   personInfoAuditMapper.insertSelective(audit);
	         			}
	            	   }
	            }
		}
		
		
		
		 return ServerResponse.createBySuccessMessage("成功");
	}

	@Override
	public ServerResponse<String> initCode() {
		for (int i = 0; i < AAS.length; i++) {
			for (int j = 0; j < 1000; j++) {
				String ss = AAS[i] + autoGenericCode(String.valueOf(j), 3);
				PersonInfoCode p = new PersonInfoCode();
				p.setId(FleaStringUtils.getGenerateUUID());
				p.setCreateUser("init");
				p.setModifyUser("init");
				p.setValid("Y");
				p.setPersonNo(ss);
				personInfoCodeMapper.insertSelective(p);
			}

		}
		return ServerResponse.createBySuccessMessage("成功");
	}

	private final String AAS[] = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q",
			"R", "S", "T", "U", "V", "W", "X", "Y", "Z" };

	public void main() {

		for (int i = 0; i < AAS.length; i++) {
			for (int j = 0; j < 1000; j++) {
				String ss = AAS[i] + autoGenericCode(String.valueOf(j), 3);
				System.out.println(ss);
			}

		}

	}

	/**
	 * 不够位数的在前面补0，保留num的长度位数字
	 * 
	 * @param code
	 * @return
	 */
	private String autoGenericCode(String code, int num) {
		String result = "";
		// 保留num的位数
		// 0 代表前面补充0
		// num 代表长度为4
		// d 代表参数为正数型
		result = String.format("%0" + num + "d", Integer.parseInt(code) + 1);

		return result;
	}

	@Override
	public ServerResponse findPicById(String id) {
		PersonInfo entity = personInfoMapper.selectByPrimaryKey(id);
		return ServerResponse.createBySuccess(entity);
	}

	@Override
	public ServerResponse<JSONObject> findGroupByProject() {
		//ALLStation
		
		List<WebDict> projects = HclvDictUtil.getHTProjectList();

		JSONObject jsonResult = new JSONObject();
		List<PersonInfo> allPersons = personInfoMapper.selectAllInit();
		int countAllStation = this.getByProjectCode("ALLStation", allPersons);
		
		jsonResult.put("ALLStation", countAllStation);
		StaticDataVo vo = new StaticDataVo("全部站点", "ALLStation", String.valueOf(countAllStation));
		
		jsonResult.put("ALLStation", vo);
		List<String> allKey = new ArrayList<String>();
		List<String> allName = new ArrayList<String>();
		List<String> allValue = new ArrayList<String>();
		List<String> allValueInRate = new ArrayList<String>();
		List<String> allValueOutRate = new ArrayList<String>();
		List<StaticDataVo> allNameValue = new ArrayList<StaticDataVo>();
		for (WebDict webDict : projects) {
			
			String projectCode = webDict.getDictCode();
			if("ALLStation".equals(projectCode)) {
				continue;
			}
			int count = this.getByProjectCode(projectCode, allPersons);
			int allCount = count+countAllStation;
			StaticDataVo v = new StaticDataVo(webDict.getDictName(), webDict.getDictCode(), String.valueOf(allCount));
			allKey.add(projectCode);
			allName.add(webDict.getDictName());
			allValue.add(String.valueOf(count+countAllStation));
			int inCount = faceInfoMapper.findByProjectCodeAndDays(projectCode, 1);
			v.setInCount(inCount);
			v.setIntRate(String.valueOf(inCount/(allCount*1.00)*100));
			int outCount = faceInfoMapper.findByProjectCodeAndDays(projectCode, 2);
			v.setOutCount(outCount);
			v.setOutRate(String.valueOf(outCount/(allCount*1.00)*100));
			allNameValue.add(v);
			allValueInRate.add(String.valueOf(inCount/(allCount*1.00)*100));
			allValueOutRate.add(String.valueOf(outCount/(allCount*1.00)*100));
			jsonResult.put(projectCode, v);
		}
		
		jsonResult.put("allKey", allKey);
		jsonResult.put("allName", allName);
		jsonResult.put("allValue", allValue);
		jsonResult.put("allData", allNameValue);
		jsonResult.put("allValueOutRate", allValueOutRate);
		jsonResult.put("allValueInRate", allValueInRate);	
		
		
		return ServerResponse.createBySuccess("操作成功", jsonResult);
	}
	private int getByProjectCode(String projectCode,List<PersonInfo> allPersons) {

		int count = 0;
		for (PersonInfo personInfo : allPersons) {
			if(personInfo!=null) {
				String orginCode = personInfo.getProjectCode();
				if(orginCode.contains(projectCode)) {
					count++;
					continue;
				}
			}
		}
		return count;
		
	}

	@Override
	public ServerResponse<JSONObject> findFaceInfo3Day() {

		//ALLStation
		
		List<WebDict> projects = HclvDictUtil.getHTProjectList();

		JSONObject jsonResult = new JSONObject();
		List<PersonInfo> allPersons = personInfoMapper.selectAllInit();
		int countAllStation = this.getByProjectCode("ALLStation", allPersons);
		
		jsonResult.put("ALLStation", countAllStation);
		StaticDataVo vo = new StaticDataVo("全部站点", "ALLStation", String.valueOf(countAllStation));
		
		jsonResult.put("ALLStation", vo);
		List<String> allKey = new ArrayList<String>();
		List<String> allName = new ArrayList<String>();
		List<String> allValue = new ArrayList<String>();
		List<String> allValueInRate = new ArrayList<String>();
		List<String> allValueOutRate = new ArrayList<String>();
		List<StaticDataVo> allNameValue = new ArrayList<StaticDataVo>();
		for (WebDict webDict : projects) {
			
			String projectCode = webDict.getDictCode();
			if("ALLStation".equals(projectCode)) {
				continue;
			}
			int count = this.getByProjectCode(projectCode, allPersons);
			int allCount = count+countAllStation;
			StaticDataVo v = new StaticDataVo(webDict.getDictName(), webDict.getDictCode(), String.valueOf(allCount));
			allKey.add(projectCode);
			allName.add(webDict.getDictName());
			allValue.add(String.valueOf(count+countAllStation));
			int inCount = faceInfoMapper.findByProjectCodeAndDays(projectCode, 1);
			v.setInCount(inCount);
			int outCount = faceInfoMapper.findByProjectCodeAndDays(projectCode, 2);
			v.setOutCount(outCount);
			allNameValue.add(v);
			allValueInRate.add(String.valueOf(inCount/(allCount*1.00)*100));
			allValueOutRate.add(String.valueOf(outCount/(allCount*1.00)*100));
			jsonResult.put(projectCode, v);
		}
		
		jsonResult.put("allKey", allKey);
		jsonResult.put("allName", allName);
		jsonResult.put("allValue", allValue);
		jsonResult.put("allData", allNameValue);
		jsonResult.put("allValueOutRate", allValueOutRate);
		jsonResult.put("allValueInRate", allValueInRate);
		
		//查询项目为ALLStation的项目人员人数
		//
		
		
		
		
	
	
		
		return null;
	}

	@Override
	public ServerResponse<FleaPage<PersonInfo>> selectAll(String bdType, int curPage, int pageSize, String projectCode,
			String name, String personNo,String team) {

		  RowBounds rowBounds = new RowBounds(curPage,pageSize);
		  
		  
		  
	        List<PersonInfo> list = personInfoMapper.selectAllByAuth(rowBounds,bdType,projectCode,name,personNo, team);
	        
	        return ServerResponse.createBySuccess(new FleaPage<>(list));
	
	}

}
